package laborhazi;

import java.awt.Color;
import java.awt.Graphics;

public class BlowAnim extends Animation {
	private Viewer viewer;
	public BlowAnim(Viewer v) {
		viewer = v;
	}
	public void animate(int[] position, Graphics g, int phase) {
		position = viewer.fieldToView(position);
		g.setColor(Color.red);
		if (phase < 10) {
			g.fillOval(position[0]+10-(phase/2), position[1]+10-(phase/2), phase, phase);
		} else {
			g.fillOval(position[0]+10-(10-(phase/2)), position[1]+10-(10-(phase/2)), 20-phase, 20-phase);
		}
	}
}
